﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Fee.Mapping
{
    public class ProjectMapping : IEntityTypeConfiguration<Project>
    {
        public void Configure(EntityTypeBuilder<Project> builder)
        {
            builder.HasKey(_ => _.Id);
            builder.Property(_ => _.Id).ValueGeneratedOnAdd();
            builder.Property(_ => _.Comment).HasMaxLength(512);
            ;
            builder.Property(_ => _.Name).HasMaxLength(128);
            ;
            builder.Property(_ => _.Amount);
            builder.Property(_ => _.StationType);
            builder.Property(_ => _.ConstructionContent).HasMaxLength(512);
            builder.Property(_ => _.ConstructionLimitationComment).HasMaxLength(512);

            builder.Property(_ => _.CreateYear);
            builder.Property(_ => _.FirstOrderTime);
            builder.Property(_ => _.LastOrderTime);

            builder.Property(_ => _.No).HasMaxLength(36);
            builder.Property(_ => _.Owner);

            builder.Property(_ => _.Station);

            builder.Property(_ => _.Status);
            builder.Property(_ => _.LevelProcess);
            builder.Property(_ => _.YearTargetDesscription).HasMaxLength(128);
            builder.Property(_ => _.Type);
            builder.HasIndex(_ => _.No);
            builder.Property(_ => _.SpecialtyPrimaryType);
            builder.Property(_ => _.SpecialtySecondaryType);
            builder.ToTable("fee_Project");
        }
    }
}